import { createRouter, createWebHashHistory } from 'vue-router'
// import HomeView from '../views/HomeView.vue'
import Home from '../views/home.vue'
// import Test from '../views/test.vue'
const routes = [
  {
    path: '/',
    name: 'home',
    component: Home,
    // 一进来 访问 / 重定向 /login  登录成功 跳转/statistic
    redirect:'/login',
    children: [
      {
        path: '/statistic',
        name: 'statistic',
        // 引入并注册
        component: () => import('../views/statistic.vue')
      },
      {
        path: '/rubbish',
        name: 'rubbish',
        // 引入并注册
        component: () => import('../views/rubbish.vue')
      },
      {
        path: '/pass',
        name: 'pass',
        // 引入并注册
        component: () => import('../views/pass.vue')
      },
      {
        path: '/eventManage',
        name: 'eventManage',
        // 引入并注册
        component: () => import('../views/eventManage.vue')
      },
      {
        path: '/userAdd',
        name: 'userAdd',
        // 引入并注册
        component: () => import('../views/userAdd.vue')
      },
      {
        path: '/systemEdit',
        name: 'systemEdit',
        // 引入并注册
        component: () => import('../views/systemEdit.vue')
      },
      {
        path: '/notice',
        name: 'notice',
        // 引入并注册
        component: () => import('../views/notice.vue')
      },
      {
        path: '/noticeAdd',
        name: 'noticeAdd',
        // 引入并注册
        component: () => import('../views/noticeAdd.vue')
      },
      {
        path: '/eventSolve',
        name: 'eventSolve',
        // 引入并注册
        component: () => import('../views/eventSolve.vue')
      },
      {
        path: '/eventAdd',
        name: 'eventAdd',
        // 引入并注册
        component: () => import('../views/eventAdd.vue')
      },
      {
        path: '/userManage',
        name: 'userManage',
        // 引入并注册
        component: () => import('../views/userManage.vue')
      },
      {
        path: '/userRegister',
        name: 'userRegister',
        // 引入并注册
        component: () => import('../views/userRegister.vue')
      },
      {
        path: '/userAdd',
        name: 'userAdd',
        // 引入并注册
        component: () => import('../views/userAdd.vue')
      },
      {
        path: '/userAdd2',
        name: 'userAdd2',
        // 引入并注册
        component: () => import('../views/userAdd2.vue')
      },
      {
        path: '/carAdd',
        name: 'carAdd',
        // 引入并注册
        component: () => import('../views/carAdd.vue')
      },
      {
        path: '/patientInfo',
        name: 'patientInfo',
        // 引入并注册
        component: () => import('../views/patientInfo.vue')
      },
      {
        path: '/patientAdd',
        name: 'patientAdd',
        // 引入并注册
        component: () => import('../views/patientAdd.vue')
      },

      {
        path: '/userEdit',
        name: 'userEdit',
        // 引入并注册
        component: () => import('../views/userEdit.vue')
      },
      {
        path: '/carRegister',
        name: 'carRegister',
        // 引入并注册
        component: () => import('../views/carRegister.vue')
      },
      {
        path: '/confirmedPatient',
        name: 'confirmedPatient',
        // 引入并注册
        component: () => import('../views/confirmedPatient.vue')
      },
      {
        path: '/touch',
        name: 'touch',
        // 引入并注册
        component: () => import('../views/touch.vue')
      },
      {
        path: '/touchAdd',
        name: 'touchAdd',
        // 引入并注册
        component: () => import('../views/touchAdd.vue')
      },
      {
        path: '/dead',
        name: 'dead',
        // 引入并注册
        component: () => import('../views/dead.vue')
      },
      {
        path: '/cure',
        name: 'cure',
        // 引入并注册
        component: () => import('../views/cure.vue')
      },
      {
        path: '/noticeUpdate',
        name: 'noticeUpdate',
        // 引入并注册
        component: () => import('../views/noticeUpdate.vue')
      },
      {
        path: '/eventUpdate',
        name: 'eventUpdate',
        // 引入并注册
        component: () => import('../views/eventUpdate.vue')
      },
      {
        path: '/touchEdit',
        name: 'touchEdit',
        // 引入并注册
        component: () => import('../views/touchEdit.vue')
      },
    ]
  },
  {
    path: '/test',
    name: 'test',
    // 引入并注册
    component: () => import('../views/test.vue')
  },
  {
    path: '/login',
    name: 'login',
    // 引入并注册
    component: () => import('../views/login.vue')
  },
  // {
  //   path: '/about',
  //   name: 'about',
  //   // route level code-splitting
  //   // this generates a separate chunk (about.[hash].js) for this route
  //   // which is lazy-loaded when the route is visited.
  //   component: () => import(/* webpackChunkName: "about" */ '../views/AboutView.vue')
  // }
]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router
